package org.example;

import javax.swing.*;
import java.awt.*;

public class PhotoFrame extends JFrame {
    private LeftPanel leftPanel;
    private RightPanel rightPanel;
    private MainP mainP;


    public PhotoFrame() {
        this.setSize(500, 500);
        this.setLocationRelativeTo(null);
        this.setTitle("相册");
        this.setResizable(false);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.addContent();
        this.setVisible(true);
    }

    private void addContent() {
        this.setLayout(null);
        this.mainP = new MainP();
        this.leftPanel = new LeftPanel(this);
        this.rightPanel = new RightPanel(this);

        this.mainP.setBounds(100, 100, 300, 300);
        this.mainP.setBackground(Color.black);
        this.rightPanel.setBounds(420, 250, 60, 60);
        this.leftPanel.setBounds(20, 250, 60, 60);

        this.add(this.mainP);
        this.add(this.rightPanel);
        this.add(this.leftPanel);
    }

    public LeftPanel getLeftPanel() {
        return leftPanel;
    }

    public void setLeftPanel(LeftPanel leftPanel) {
        this.leftPanel = leftPanel;
    }

    public RightPanel getRightPanel() {
        return rightPanel;
    }

    public void setRightPanel(RightPanel rightPanel) {
        this.rightPanel = rightPanel;
    }

    public MainP getMainP() {
        return mainP;
    }

    public void setMainP(MainP mainP) {
        this.mainP = mainP;
    }
}
